package messaage;

import java.util.List;
import com.thoughtworks.xstream.XStream;
import com.thoughtworks.xstream.io.xml.DomDriver;
import forum.Thread;

/**
 * @author Olga
 * 
 */
public class GotTopicsOfForumMsg extends Message {

	protected List<forum.Thread> topics;
	protected String forumID;

	/**
	 * 
	 */
	public GotTopicsOfForumMsg(List<Thread> threads, String forumID) {
		this.topics = threads;
		this.forumID = forumID;
		this.type = "GotTopicsOfForumMsg";
	}

	@Override
	public String toString() {
		XStream xstream = new XStream(new DomDriver());
		String xml = xstream.toXML(this)+"\0";

		return xml;
	}

	public List<Thread> getListOfTopics() {
		return this.topics;
	}

	public int getForumID() {
		return Integer.parseInt(this.forumID);
	}
}
